package com.foreknow.demo7;

public class Test {
    public static void main(String[] args) {
        UserManager manager = new UserManager();
        User user = new User();
        user.setId("1001");
        user.setName("tom");
        user.setAge(30);
        user.setSex("男");
        user.setHib("music");

        User user1 = new User();
        user1.setId("1002");
        user1.setName("tom2");
        user1.setAge(32);
        user1.setSex("女");
        user1.setHib("rock");

        //添加用户
        manager.addUser(user);
        manager.addUser(user1);

        //调用方法根据id查询用户信息
        User u = manager.getQueryById("1002");
        if(u != null) {
            System.out.println(u.getId()+"--"+u.getName());
        }
    }
}
